package com.example.zrq1010110087.activitylifestyle_log;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {


    private static  final String TAG="LogActivity";
    private Button button;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.i(TAG,"MainActivity--->onCreate");
        button=(Button) findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent i=new Intent(MainActivity.this,SecondActivity.class);
                startActivity(i);

            }
        });
    }

    @Override
    protected void onStart() {

        Log.i(TAG,"MainActivity--->onStart");
        super.onStart();
    }

    @Override
    protected void onResume() {
        Log.i(TAG,"MainActivity--->onResume");
        super.onResume();
    }

    @Override
    protected void onPause() {
        Log.i(TAG,"MainActivity--->onPause");
        super.onPause();
    }

    @Override
    protected void onStop() {
        Log.i(TAG,"MainActivity--->onStop");
        super.onStop();
    }

    @Override
    protected void onDestroy() {
        Log.i(TAG,"MainActivity--->onDestroy");
        super.onDestroy();
    }
}
